import java.net.InetAddress;

public class Demo1 {
    public static void main(String[] args) throws Exception{
        InetAddress localAdress = InetAddress.getLocalHost();
        InetAddress removeAddress = InetAddress.getByName("www.baidu.com");
        System.out.println("本机IP地址:"+localAdress);
        System.out.println("百度IP地址:"+removeAddress);
        System.out.println("Hello World!");
    }
}
